import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * @Author 12629
 * @Description：
 */
class Person {
    public String name;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}



public class Test2 {

    public static void func(int[] array) throws CloneNotSupportedException {
        if(array == null) {
            throw new CloneNotSupportedException();
        }
    }

    public static void main(String[] args) {
        try {
            func(null);
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
    }

    public static int function() {
        Scanner scanner = new Scanner(System.in);
        try {
            int a = scanner.nextInt();//8
            return a;
        }catch (InputMismatchException e) {
            e.printStackTrace();
        }finally {
            return 99;
        }
    }

    public static void main8(String[] args) {
        System.out.println(function());
    }

    public static void main7(String[] args) {
        Scanner scanner = new Scanner(System.in);
        try {
            int a = scanner.nextInt();
            System.out.println(a);
        }catch (InputMismatchException e) {
            e.printStackTrace();
            System.out.println("输入的数据存在问题...");
        }finally {
            scanner.close();
        }
    }

    public static void main6(String[] args) {
        try {
            int[] array = {1,2,3};
            System.out.println(array[1]);
            System.out.println("hello...");
        }catch (ArrayIndexOutOfBoundsException e) {
            e.printStackTrace();
            System.out.println("数组越界异常...");
        }catch (NullPointerException e) {
            e.printStackTrace();
            System.out.println("空指针异常...");
        }finally {
            System.out.println("finally被执行了....");
        }

        System.out.println("程序继续执行....");
    }

    public static void main5(String[] args) {
        try {
            int[] array = {1,2,3};
            System.out.println(array[10]);
            System.out.println("hello...");
        }catch (ArrayIndexOutOfBoundsException | NullPointerException e) {
            e.printStackTrace();
            //System.out.println("数组越界异常...");
        }
        System.out.println("程序继续执行....");
    }

    public static void main4(String[] args) {
        try {
            int[] array = {1,2,3};
            System.out.println(array[10]);
            System.out.println("hello...");
        }catch (ArrayIndexOutOfBoundsException e) {
            e.printStackTrace();
            System.out.println("数组越界异常...");
        }catch (NullPointerException e) {
            e.printStackTrace();
            System.out.println("空指针异常...");
        }
        System.out.println("程序继续执行....");
    }



    public static void main3(String[] args)  {

        try {
            //可能出现异常的代码
            func(null);
        } catch (CloneNotSupportedException e) {
            System.out.println("捕获了 CloneNotSupportedException... ");
        }

        System.out.println("程序可以继续执行了....");

    }


    public static void main2(String[] args) throws CloneNotSupportedException{
        /*Person person = new Person();
        Person person1 = (Person)person.clone();
*/
    }
    public static void main1(String[] args) {
        /*System.out.println(10/0);
        System.out.println("继续执行.....");*/
        int[] array = {1,2,3};
        array = null;
        System.out.println(array.length);
    }
}
